<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>商户信息列表</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link href="<s:url value="/css/a.css"/>" type="text/css"
	rel="stylesheet" />
<link href="<s:url value="/css/index.css"/>" type="text/css"

	rel="stylesheet" />
	
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>

<style>
　　　
　　　　　a {
	text-decoration: none
}

　　　　　a:hover {
	color: red;
	text-decoration: none
}

a:VISITED {
	color: red;
}
　　


　　　
</style>

<script type="text/javascript">

	$(document).ready(function() {
	
			$("#query").click(function() {
						   	$("#queryUserForm").attr("action","<%=basePath%>/merinfoBatchExport/queryMerinfoExport.ct");
						   	$("#queryUserForm").submit();   
						    return false;
							        
							
						});
			
			$("#export").click(function() {
						   	$("#queryUserForm").attr("action","<%=basePath%>/merinfoBatchExport/batchExport.ct");
						   	$("#queryUserForm").submit();   
						    return false;
							        
							
						});
					
			$("#someExport").click(function() {
							 var len=$("#tableList").find(":checkbox[name=multi_sel_str]:checked").length;
							 if(len<=0){
							 	alert('请先择要导出的商户！！！');
								return false;
							 }
							if(len>0){
							  // alert("--");
						  	 	$("#queryUserForm").attr("action","<%=basePath%>/merinfoBatchExport/someExport.ct");
						   		$("#queryUserForm").submit();
						   		
						  	  return false;
						  	  }
							        
							
						});

			});

	
</script>



</head>

<body>

	<div class="subpage">
		<s:form id="queryUserForm" action="/merinfoBatchExport/queryMerinfoExport.ct" method="post"
			theme="simple">
			<div class="user_title">
	    		 <h2 class="headline-inquires">POS收单运营管理平台<br />
	    		 <span class="sub-title">

	    		 </span></h2>
	    		</div>
			<table width="120%" cellpadding="0" cellspacing="0" border="0"
				class="query_table">

				<tr>
					<td colspan="4" align="center">
						<h2 class="headline-inquires">
							商户信息列表<br />
							<span class="sub-title"></span>
						</h2>

					</td>
				</tr>


				<tr>
					<td colspan="4">&nbsp;</td>
				</tr>

			<tr><s:if test="#session.session_merchant.roleType==\"03\"||#session.session_merchant.roleType==\"15\"||#session.session_merchant.roleType==\"16\"">
                </s:if><s:else>
                <td align="right" width="15%">所属机构：</td>
						<td>
						<s:if test="#session.session_merchant.roleType==\"00\"||#session.session_merchant.roleType==\"01\"">
							
							<s:select cssClass="queryWidth" name="searchCondition.orgCode"
								list="#request.orgList" listKey="org_code" listValue="org_name" headerKey="99" headerValue="--请选择--" />
						</s:if>
						<s:else>
							<s:select cssClass="queryWidth" name="searchCondition.orgCode"
								list="#request.orgList" listKey="org_code" listValue="org_name" />
						
						</s:else>
						</td></s:else>
				<td align="right" width="15%">商户号：</td>
				<td>
						<s:textfield  name="searchCondition.merchantNo" cssClass="queryWidth" />
				</td></tr>
				<tr>
					<td align="right">商户名称：</td>
					<td align="left" colspan="1"><s:textfield id="accountNo"
							name="searchCondition.merchantName" cssClass="queryWidth" /></td>
					<td align="right">营业名称：</td>
					<td align="left" colspan="1"><s:textfield id="realName"
							name="searchCondition.merBrName" cssClass="queryWidth" /></td>
				</tr>
				<tr>
					<td align="right">所属地区：</td>
					<td align="left" colspan="1">
						<s:select cssClass="queryWidth" name="searchCondition.areaCode"
								
								list="#request.areaList" listKey="key" listValue="value"  headerKey="99" headerValue="--请选择--" />
					</td>
					<td align="right">证件号：</td>
					<td align="left" colspan="1"><s:textfield id="cardNo"
							name="searchCondition.cardNo" cssClass="queryWidth" /></td>
				</tr>
				<tr>
					<td align="right">mcc编码：</td>
					<td align="left" >
						<s:textfield name="searchCondition.mccName" cssClass="queryWidth" />
					</td>
					<td align="right">商户注册地址：</td>
					<td align="left"  >
						<s:textfield name="searchCondition.addr" cssClass="queryWidth" /> 
					</td>
				</tr>
				<tr>
					<td align="right">商户类型：</td>
					<td align="left"  >
						<s:select  name="searchCondition.midType" list="#{'01':'企业单位','02':'个体工商户'}" headerKey="99" headerValue="--请选择--" cssClass="queryWidth" /> 
					</td>
					<td align="right">所属代理商：</td>
					<td align="left"  >
						<s:textfield name="searchCondition.realName" cssClass="queryWidth" /> 
				</tr>
				<tr><td align="right">风控级别：</td>
					<td align="left"  >
						<s:select  name="searchCondition.merStatus" list="#{'A0':'正常','A1':'提示级','A2':'关注级','A3':'预警级','A4':'拒绝级'}" headerKey="99" headerValue="--请选择--" cssClass="queryWidth" /> 
					</td>
				</tr>
				<tr>
						<td colspan="4" align="center"><span style="font-color: red"><s:actionerror /></span>
							<span style="font-color: red;"><s:actionmessage /></span > <span style="font-color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
					</tr>
				<tr>
					<td colspan="4" align="right"><s:submit id="query" value="查 询" />
						&nbsp;&nbsp;&nbsp;&nbsp; <s:reset value="取 消" />&nbsp;&nbsp;&nbsp;&nbsp; </td>
				</tr>
				<tr><s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
					<td colspan="4" align="right"><s:submit id="export" value="商户详情批量导出"/>&nbsp;&nbsp; 
					<s:submit id="someExport" value="部分商户详情批量导出"/>&nbsp;&nbsp;&nbsp;&nbsp; </td>
					</s:if><s:else>
					<td colspan="4" align="right"><s:submit id="export" disabled="true" value="商户详情批量导出"/>&nbsp;&nbsp; 
					<s:submit id="someExport" disabled="true" value="部分商户详情批量导出"/>&nbsp;&nbsp;&nbsp;&nbsp; </td></s:else>	
				</tr>
				<tr>
					<td colspan="4">&nbsp;</td>
				</tr>
			</table>
			<table width="100%" cellpadding="0" cellspacing="0" border="0">

				<tr>
					<td colspan="4" align="center">
						<h2 class="headline-inquires">商户基本信息列表</h2>

					</td>
				</tr>
				<s:if
					test="#request.searchRsList != null && #request.searchRsList.size>0">
					<tr>
						<td align="left">&nbsp;&nbsp;&nbsp;&nbsp; <page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/merinfoBatchExport/queryMerinfoExport.ct?currentPage=" />

						</td>
					</tr>
				</s:if>
			</table>
		
			<table id="tableList" width="130%" class="table">
				<thead>
					<tr>
					    <th>选择</th>
						<th>商户号</th>
						<th>商户名称</th>
						<th>营业名称</th>
						<th>商户类型</th>
						<th>商户状态</th>
						<th>所属代理商</th>
						<th>业务联系人 </th>
						<th>法人名称</th>
						<th>法人电话</th>
						<th>结算周期</th>
						<th>扣率类型</th>
						<th>扣率(%)</th>
						<th>封顶金额</th>
						<th>营业执照</th>
						<th>证件号码</th>
						<th>所属地区</th>
						<th>注册地址</th>
						<th>风控级别</th>
						
					</tr>
				</thead>
				<tbody>
					<s:iterator value="#request.searchRsList" status="stat" id="sh">
							<tr class="<s:if test="#stat.index%2==0">tr_0</s:if>" >
						   <td align="center">
					        	   <s:checkboxlist  name="multi_sel_str" list="#{#sh.mid:''}"  theme="simple" />
					       </td>
							<td>
								<s:property value="#sh.mid"/> 
							</td>
							<td width="200px;"><s:property value="#sh.merName"/></td>
					       <td><s:property value="#sh.merBrName"/></td>
					       <td>
					       		<s:if test="#sh.merKind == \"01\"">企业单位</s:if>
					       		<s:elseif test="#sh.merKind ==\"02\"">个体工商户</s:elseif>
					       </td>
					       <td><s:property value="#sh.flag"/></td>
					       <td><s:property value="#sh.realName"/> </td>
					       <td><s:property value="#sh.interContact"/></td>
					       <td><s:property value="#sh.perName"/></td>
					       <td><s:property value="#sh.perPhone"/></td>
					       <td>
					       		<s:iterator value="#request.cycList" id="cyc">
					       			<s:if test="#cyc.cycleId == #sh.cycleId ">
					       				<s:property value="#cyc.cycleName"/>
					       			</s:if>
					       		</s:iterator>
					       </td>
					       
					        <td>
					        	<s:if test="#sh.rateType==\"1\"">点数</s:if>
					        	<s:if test="#sh.rateType==\"3\"">封顶</s:if>
					        </td>
					        <td><page:amount amount="${sh.rate}"/></td>
					         <td><page:amount amount="${sh.amt}"/></td>
					          <td><s:property value="#sh.bus_lic"/></td>
					       <td><s:property value="#sh.cardNo"/></td>
					      
					       <td>
					       		<s:iterator value="#request.areaList" id="area">
					       			<s:if test="#area.key == #sh.areaCode">
					       				<s:property value="#area.value"/>
					       			</s:if>
					       		</s:iterator>
					       </td>
					       <td><s:property value="#sh.addr"/></td>
					        <td><s:property value="#sh.merStatus"/></td>
					     
						</s:iterator>
				</tbody>
			</table></s:form>
	</div>
	<s:if test="#request.msg !=null">
		<script language="javascript">
			alert("${request.msg}");
		</script>
	</s:if>

</body>
</html>
